package com.yh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yh.bean.BBS;
import com.yh.bean.BBSUserShow;
import com.yh.bean.ReplyBBS;
import com.yh.bean.User;
import com.yh.dao.BBSDao;
import com.yh.service.BBSService;

@Service("bbs")
public class BBSServiceImpl implements BBSService{

	@Autowired
	private BBSDao bbsDao;
	
	@Override
	public List<BBS> querybbs(BBS bbs) {
		// TODO Auto-generated method stub
		List<BBS> blist=bbsDao.querybbs(bbs);
		System.out.println("查询impl测试"+blist);
		return blist;
	}

	@Override
	public int insertbbs(BBS bbs) {
		// TODO Auto-generated method stub
		int a=bbsDao.insertbbs(bbs);
		return a;
	}

	@Override
	public int deletebbs(int bid) {
		// TODO Auto-generated method stub
		int a=bbsDao.deletebbs(bid);
		System.out.println("数据已经删除");
		return a;
	}

	@Override
	public BBS showbbs(int bid) {
		// TODO Auto-generated method stub
		BBS bbs=bbsDao.showbbs(bid);
		return bbs;
	}

	@Override
	public int insertRebbs(ReplyBBS reply) {
		// TODO Auto-generated method stub
		int a =bbsDao.insertRebbs(reply);
		return a;
	}

	@Override
	public List<ReplyBBS> queryReply(int rebbs_bid) {
		// TODO Auto-generated method stub
		List<ReplyBBS> reply=bbsDao.queryReply(rebbs_bid);
		return reply;
	}

	@Override
	public int deleteReply(int reid) {
		// TODO Auto-generated method stub
		int a=bbsDao.deleteReply(reid);
		return a;
	}

	@Override
	public List<BBS> queryUserBBS(int userid) {
		// TODO Auto-generated method stub
		List<BBS> blist=bbsDao.queryUserBBS(userid);
		return blist;
	}

	@Override
	public List<ReplyBBS> queryUserReply(int userid) {
		// TODO Auto-generated method stub
		List<ReplyBBS> rlist=bbsDao.queryUserReply(userid);
		return rlist;
	}
	
	
}
